#include <public/config.h>
#include <public/uart_dev_getchar.h>
#include <public/basic_types.h>

#define STATUS_REG_OFFSET	0x08
#define DATA_REG_OFFSET	0x00
#define UART_DRA	0x01

void dev_getchar(uint8_t *car)
{
	volatile uint32_t uart_status;

	/*  Waiting for ready data in the a channel */
	while(!((uart_status = UART_REGISTER(STATUS_REG_OFFSET)) & UART_DRA));
	*car = (uint8_t) (UART_REGISTER(DATA_REG_OFFSET));
}
